import request from '@/utils/request'

//  门店列表
export function listMemberRule(query) {
  return request({
    url: '/system/member/rule/list',
    method: 'get',
    params: query
  })
}

// 会员卡规则列表
export function listRule(query) {
  return request({
    url: '/system/membercrossrule/list',
    method: 'get',
    params: query
  })
}


// 被设置会员卡规则列表
export function listRuleBy(query) {
  return request({
    url: '/system/membercrossrule/listby',
    method: 'get',
    params: query
  })
}



// 门店会员卡列表
export function listStoreMember(query) {
  return request({
    url: '/system/member/rule/list',
    method: 'get',
    params: query
  })
}

//详情
export function getMemberRule(id) {
  return request({
    url: '/system/member/rule/' + id,
    method: 'get'
  })
}

//新增
export function addMemberRule(data) {
  return request({
    url: '/system/membercrossrule/editAdd',
    method: 'post',
    data: data
  })
}

//修改
export function updateMemberRule(data) {
  return request({
    url: '/system/membercrossrule',
    method: 'put',
    data: data
  })
}
//删除
export function delMemberRule(id) {
  return request({
    url: '/system/member/rule/' + id,
    method: 'delete'
  })
}

export function listMemberRegion(query) {
  return request({
    url: '/system/region/addList',
    method: 'get',
    params: query
  })
}
export function listMemberStore(query) {
  return request({
    url: '/system/store/allList',
    method: 'get',
    params: query
  })
}
//提交(新)
export function submitCross(data) {
  return request({
    url: '/system/membercrossrule/editAdd',
    method: 'post',
    data: data
  })
}

//设置方审核(新)
export function zyMemberCrossCheck(data) {
  return request({
    url: '/system/membercrossrule/zyMemberCrossCheck',
    method: 'post',
    data: data
  })
}

//被设置方审核(新)
export function zyMemberCrossCheckBy(data) {
  return request({
    url: '/system/membercrossrule/zyMemberCrossCheckBy',
    method: 'post',
    data: data
  })
}




//删除规则
export const deleteRule = (id) => {
  return request({
    url: `/system/membercrossrule/${id}`,
    method: 'delete'
  })
}

//获取详情(新)
export const getDetail = (id) => {
  return request({
    url: `/system/membercrossrule/${id}`,
    method: 'get'
  })
}